Skip to content

Python: fix static arguments on methods and class constructors - #263

Merged
Tom-Kingstone merged 6 commits into
developfrom
Python_Toolkit-#260-FixStaticArguments
Nov 10, 2026
Merged

Tom-Kingstone merged 6 commits into
developfrom
Python_Toolkit-#260-FixStaticArguments

Conversation

@Tom-Kingstone

Copy link
Copy Markdown
Contributor

NOTE: Depends on

Issues addressed by this PR

Closes #260

see issue, this fixes the problem where applicable across the toolkit.

Also fixed deprecation warnings for datetime.utcnow() (as the method was being changed anyway) and fixed anywhere that it was being called directly with non timezone aware datetimes.

Test files

run the python unit test scripts.

Changelog

Additional comments

@Tom-Kingstone Tom-Kingstone self-assigned this Oct 29, 2026
@Tom-Kingstone Tom-Kingstone added the type:bug Error or unexpected behaviour label Oct 29, 2026
Felix-Mallinder

This comment was marked as resolved.

@Tom-Kingstone

Copy link
Copy Markdown
Contributor Author

@BHoMBot check core

@bhombot-ci

bhombot-ci Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Tom-Kingstone to confirm, the following actions are now queued:

  • check core

There are 99 requests in the queue ahead of you.

@jamesramsden-bh jamesramsden-bh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original fix introduced this bug:

Every pandas Timestamp crashes when converted. bson_unix_ticks and json.dumps(..., cls=BHoMJSONEncoder) both raise TypeError: tz_convert() takes exactly 2 positional arguments (1 given), for timestamps with and without a timezone. This breaks saving any BHoM object that holds a timestamp, and nothing in the test suite covers it. The fix is date_time.tz_convert("UTC").

This has now been resolved, and automated tests passing. Happy to approve.

@jamesramsden-bh

Copy link
Copy Markdown
Contributor

@BHoMBot check required

@bhombot-ci

bhombot-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown

@jamesramsden-bh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 550 requests in the queue ahead of you.

@Tom-Kingstone

Copy link
Copy Markdown
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Nov 10, 2026

Copy link
Copy Markdown

@Tom-Kingstone to confirm, the following actions are now queued:

  • check ready-to-merge

There are 167 requests in the queue ahead of you.

@Tom-Kingstone

Copy link
Copy Markdown
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Nov 10, 2026

Copy link
Copy Markdown

@Tom-Kingstone to confirm, the following actions are now queued:

  • check ready-to-merge

There are 162 requests in the queue ahead of you.

@Tom-Kingstone
Tom-Kingstone merged commit d9d1edd into develop Nov 10, 2026
19 checks passed
@Tom-Kingstone
Tom-Kingstone deleted the Python_Toolkit-#260-FixStaticArguments branch November 10, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Error or unexpected behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix python using the same property for multiple instances of a class if the property has an initialiser in the constructor arguments

3 participants